<?php
require_once(dirname(__FILE__)."/config.php");
CheckPurview('plus_幻灯片管理');
if(empty($dopost)) $dopost = '';
if($dopost=="add")
{
	if(empty($typename))
	{
		ShowMsg("幻灯片组名不能为空！","-1");
		exit();
	}
	$query = "INSERT INTO `#@__flashtype`(typename) VALUES('{$typename}');";
	$dsql->ExecuteNoneQuery($query);
	ShowMsg("成功增加一个幻灯片组！","flash_type.php");
	exit();
}
else if($dopost=="edit")
{
	if(empty($id) || empty($typename))
	{
		ShowMsg("参数错误！","flash_type.php");
		exit();
	}
	$query = "UPDATE `#@__flashtype` SET typename='$typename' WHERE id='$id' ";
	$dsql->ExecuteNoneQuery($query);
	ShowMsg("成功更新幻灯片组！", "flash_type.php");
    exit;
}
else if($dopost=="delete")
{
	if(empty($id))
	{
		ShowMsg("参数错误！","flash_type.php");
		exit();
	}
	$query = "DELETE FROM `#@__flashtype` WHERE id='$id' ";
	$dsql->ExecuteNoneQuery($query);
	ShowMsg("成功删除一个幻灯片组！", "flash_type.php");
    exit;
}
include DedeInclude('templets/flash_type.htm');